(** Some types to deal with points in the plane
  described by their angle and module *)

type angle = int;;
type speed = float;;
type vector = Vec of angle * speed;;
type point = Pt of float*float;; 

let center = Vec (0,0.0);;

let pi = 3.14159265;;
let d_cos x = cos ((float_of_int (90 - x) ) /. 90. *. pi /. 2.) ;;
let d_sin x = sin ((float_of_int (90 - x) ) /. 90. *. pi /. 2.) ;;

let point_of_vector (Vec (head,speed)) =
  let 
    x = (d_cos head) *. speed 
  and
    y = (d_sin head) *. speed
  in
    Pt (x,y)
;;

